package widgets;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener;
import android.widget.RelativeLayout;

public class RelativeLayoutTest1 extends RelativeLayout implements OnClickListener, OnTouchListener {
	//	private static final String TAG = RelativeLayoutTest1.class.getSimpleName();
	private static final String TAG = "L111111";
	/**
	 * 懒得删除了
	 */
	private String w = "";

	public RelativeLayoutTest1(Context context, AttributeSet attrs) {
		super(context, attrs);
		//				this.setOnClickListener(this);
		//				this.setOnTouchListener(this);
		Log.v(TAG, "RelativeLayoutTest" + "\t" + w);
	}

	@Override
	public boolean dispatchTouchEvent(MotionEvent ev) {
		Log.v(TAG, "dispatchTouchEvent" + "\t" + w);
		return super.dispatchTouchEvent(ev);
		//		return true;
	}

	@Override
	public boolean onInterceptTouchEvent(MotionEvent ev) {
		Log.v(TAG, "onInterceptTouchEvent" + "\t" + w);
		switch (ev.getAction()) {
		case MotionEvent.ACTION_MOVE:
			return true;
		default:
			break;
		}
		return super.onInterceptTouchEvent(ev);
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		Log.v(TAG, "onTouchEvent" + "\t" + w);

		switch (event.getAction()) {
		case MotionEvent.ACTION_DOWN:
			Log.v(TAG, "↓↓↓↓" + "\t" + w);
			break;
		case MotionEvent.ACTION_MOVE:
			Log.v(TAG, "→←→←→←" + "\t" + w);
			break;
		case MotionEvent.ACTION_UP:
			Log.v(TAG, "↑↑↑↑" + "\t" + w);
			break;
		case MotionEvent.ACTION_SCROLL:
			Log.v(TAG, "→←↑↓→←↑↓" + "\t" + w);
			break;
		default:
			break;
		}

		return super.onTouchEvent(event);
		//				return true;
		//		return false;
	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {
		Log.v(TAG, "onTouch");
		return false;
	}

	@Override
	public void onClick(View v) {
		Log.v(TAG, "onClick");
	}

}
